package com.wangshuqi.spring.service.impl;

import com.wangshuqi.spring.dao.UserDAO;
import com.wangshuqi.spring.entity.User;
import com.wangshuqi.spring.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;

    @Override
    public User selectById(Integer id) {
        User user = userDAO.selectById(id);
//        int i = 10 / id;
        return user;
    }

    @Override
    public List<User> selectByName(String name) {
        return userDAO.selectByName(name);
    }

    @Override
    public Integer selectCountByName(String name) {
        return userDAO.selectCountByName(name);
    }
}
